package logic.regulardevices;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Cloneable for safe-copying states before simulating electricity cut.
 * @author Martin
 *
 */
public abstract class RegularDevice {

	protected String id;
	protected final String INVALIDCMD = "_cmdNotSupportedByDevice";
	
	public boolean isRecipient(String id) {
		if( this.id.equals(id))
			return true;
		return false;
	}
	
	/**
	 * Takes commands, interprets it, responds back.
	 * @param cmd
	 * @return
	 */
	public abstract String receiveAndRespond(String cmd);
	/**
	 * The check-function
	 * @return A check of the devices value.
	 */
	public abstract String check();
	public abstract String test();
	
	protected String invalidCommand() {
		return id+INVALIDCMD;
	}
}
